package com.xm.servlet.reception_desk.center;

import lombok.SneakyThrows;


import javax.servlet.http.*;
import javax.servlet.annotation.*;


/**
 * @author lenovo
 */
@WebServlet(name = "OrderServlet", value = "/order")
public class OrderServlet extends HttpServlet {
    @SneakyThrows(Exception.class)
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)  {
        String oid=request.getParameter("order_id") ;
        String menu = request.getParameter("menu") == null ?  "3" : request.getParameter("menu");
        if(oid!=null){
            HttpSession session=request.getSession();
            session.setAttribute("order_id",oid);
        }
        request.setAttribute("menu",menu);
        request.getRequestDispatcher("/WEB-INF/page/reception_desk/center.jsp").forward(request,response);
    }

    @SneakyThrows(Exception.class)
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) {
        request.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        response.setCharacterEncoding("utf-8");
        String action=request.getParameter("action");
    }
}
